<?php $view->extend('admin/template', 'content', array('title' => 'News admin' . (isset($title) ? ' - '.$title : ''))); ?>

<div class="col c3">
	<h2><a href="<?php echo $view->url->linkTo('Admin','news',array('index'))?>">News</a></h2>
	<ul class="menu">	
		<li><h4><a href="<?php echo $view->url->linkTo('Admin','news',array('add'))?>">Add news</a></h4></li>
	</ul>
	
	<?php if (isset($tips)):?>
	<h2>Tips</h2>
	<div class="message info">
		<p><?php echo $tips;?></p>
	</div>
	<?php endif;?>
	
</div>

<div class="col c6">
	<?php $content = $view->getExtend('content')?>
	<?php if ($content): echo $content; else:?>
		<h2>News panel</h2>
		<p>News administration panel.</p>
		
		
		<h2>Latest news</h2>
		<?php if (count($news) > 0): ?>
		<table class="nice" cellspacing="0" summary="Latest news">
			<caption>Server statistics</caption>
			<tr>
				<th scope="col" abbr="Title" class="nobg">Title</th>
				<th scope="col" abbr="Edit">Edit</th>
				<th scope="col" abbr="Delete">Delete</th>
			</tr>
			
			
			<?php foreach($news as $n):?>
				<tr>
					<td><?php echo $n->getTitle()?></td>
					<td><h4><a href="<?php echo $view->url->linkTo('Admin','news', array('delete', $n->getID()))?>">Delete</a></h4></td>
					<td><h4><a href="<?php echo $view->url->linkTo('Admin','news', array('edit', $n->getID()))?>">Edit</a></h4></td>
				</tr>
			<?php endforeach;?>		

		</table>	
		<?php else: ?>
			<div class="message info"><p>There are no news yet.</p></div>	
		<?php endif;?>
		
	<?php endif;?>
</div>
